import { getApi } from '@/api/knife4j'

const getDefaultState = () => {}

const state = getDefaultState()

const mutations = {}

const actions = {
  // api接口
  async getApi({ state }, course) {
    return new Promise((resolve, reject) => {
      getApi(course)
        .then((response) => {
          resolve(response)
        })
        .catch((error) => {
          reject(error)
        })
    })
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
}
